﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

#if !WINRT
using System.Windows.Data;
#else
using Windows.UI.Xaml.Data;
#endif

namespace MishraReader.Converters
{
#if !WINRT
    [ValueConversion(typeof(int), typeof(string))]
#endif
    public class UnreadCountToOverlayTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, 
#if !WINRT
            CultureInfo culture
#else
            string language
#endif
            )
        {
            if (value is int)
            {
                var count = (int)value;

                return count <= 100 ? count.ToString(CultureInfo.InvariantCulture) : "+";
            }

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter,
#if !WINRT
            CultureInfo culture
#else
 string language
#endif
)
        {
            throw new NotImplementedException();
        }
    }
}